using UnityEngine;

namespace Galplay {
  internal class ScriptBG : GalScript {
    public string ShowType { get; set; }
    public string Filename { get;  }

    public ScriptBG(GalScene owner, XmlNode item): base(owner, item, ScriptType.BG) {
      Filename = Kit.AutoAddExtension(item.InnerText, ".png");
      ShowType = item.GetStr("ShowType");
    }

    public override void Execute(GameScenePlayer player) {
      player.imageManager.SetBg(GetImageFilename());
    }

    public string GetImageFilename(){
      return Kit.AutoCombine(GM.Game.ImagePath, Filename);
    }
  }
}